/**
 * @ClassName LC367
 * @Author ykx
 * @Date 2024/3/10 16:31
 * @Version 1.0
 */
public class LC367 {
    public boolean isPerfectSquare(int num) {
        int i = 0;
        if (num < 0) {
            return false;
        }
        while (i * i < num) {
            i++;
            if (i * i < 0) {
                break;
            }
        }
        return i * i == num;
    }
}
